package com.zhang.network.model.recommend;

import com.zhang.network.model.User;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Comparator;

/**
 * @author
 */
@Data
public class IntelligentRecommendVO implements Comparable<IntelligentRecommendVO> {
    /**
     * 1. 查找所有非好友的用户列表
     * 2. 遍历
     * 2.1 判断是否在相同人脉圈内
     * 2.2 判断是否同省、若同省判断是否同市
     * 2.3 判断职业是否相似
     * 2.4 遍历该好友与自己的共同好友数量
     * 3. 根据不同权重给关联度赋值
     */
    @ApiModelProperty(value = "user对象")
    private User user;

    @ApiModelProperty(value = "同人脉圈")
    private Boolean sameNetwork;

    @ApiModelProperty(value = "同省")
    private Boolean sameProvince;

    @ApiModelProperty(value = "同省同市")
    private Boolean sameCity;

    @ApiModelProperty(value = "相似职业")
    private Boolean likeProfession;

    @ApiModelProperty(value = "共同好友数量")
    private Integer sameFriendNum;

    @ApiModelProperty(value = "关联度")
    private Integer correlationDegree;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Boolean getSameNetwork() {
        return sameNetwork;
    }

    public Boolean setSameNetwork(Boolean sameNetwork) {
        this.sameNetwork = sameNetwork;
        return this.sameNetwork;
    }

    public Boolean getSameProvince() {
        return sameProvince;
    }

    public Boolean setSameProvince(Boolean sameProvince) {
        this.sameProvince = sameProvince;
        return this.sameProvince;
    }

    public Boolean getSameCity() {
        return sameCity;
    }

    public Boolean setSameCity(Boolean sameCity) {
        this.sameCity = sameCity;
        return this.sameCity;
    }

    public Boolean getLikeProfession() {
        return likeProfession;
    }

    public Boolean setLikeProfession(Boolean likeProfession) {
        this.likeProfession = likeProfession;
        return this.likeProfession;
    }

    public Integer getSameFriendNum() {
        return sameFriendNum;
    }

    public void setSameFriendNum(Integer sameFriendNum) {
        this.sameFriendNum = sameFriendNum;
    }

    public Integer getCorrelationDegree() {
        return correlationDegree;
    }

    public void setCorrelationDegree(Integer correlationDegree) {
        this.correlationDegree = correlationDegree;
    }

    @Override
    public int compareTo(IntelligentRecommendVO o) {
        return this.correlationDegree.compareTo(o.getCorrelationDegree());
    }
    

    @Override
    public String toString() {
        return "IntelligentRecommendVO{" +
                "user=" + user +
                ", sameNetwork=" + sameNetwork +
                ", sameProvince=" + sameProvince +
                ", sameCity=" + sameCity +
                ", likeProfession=" + likeProfession +
                ", sameFriendNum=" + sameFriendNum +
                ", correlationDegree=" + correlationDegree +
                '}';
    }
}
